package 序列化;

import java.io.*;

public class outputstreamwriter {
    public static void main(String[]args){
        File file=new File("e:\\ss.txt");
        try {
            OutputStreamWriter q=new OutputStreamWriter(new FileOutputStream(file),"utf-8");
            String s="啦啦啦啦啦啦啦啦";
            try {
                q.write(s);
                q.close();
                InputStreamReader isr =new InputStreamReader(new FileInputStream(file),"utf-8");
                int c=isr.read();
                while (c!=-1){
                    System.out.print((char) c);
                    c=isr.read();
                }

            } catch (IOException e) {
                e.printStackTrace();
            }

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
